home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Sapphire Collection / Software Vault (Sapphire Collection) (Digital Impact).ISO / cdr47 / trace122.zip / TRACE1E.AIC < prev   
Text File  |  1997-02-13  |  8KB  |  224 lines

  1. ;*******************************************************
  2. ;    B E G I N     C O N F I G U R A T I O N
  3. ;    TRACE1E.AIC built by Arny Krueger 02/22/86
  4. ;
  5. ;*******************************************************
  6.  
  7. ;
  8. ;  Some general equates for civilized coding
  9. ;
  10.  
  11.  
  12. cr             equ     13
  13. lf             equ     10
  14.  
  15. ;********************************************************
  16. ;
  17. ; Equates used for general configuration
  18. ;
  19. ;********************************************************
  20.  
  21. ;
  22. ; Set trace_size to number of K bytes to set aside for trace table.
  23. ;
  24.  
  25. trace_size      equ     30
  26.  
  27. ;
  28. ; Set iamhere to be a flag that indicates we are already in place.
  29. ; The first byte is interpreted as a DOS function number (AH) for INT 21h
  30. ;
  31.  
  32. iamhere         equ     0E0E0h
  33.  
  34. ;
  35. ; Set peri_int to the interrupt number (usually 060H) to be used
  36. ; by Periscope to invoke our reporting routines.
  37. ;
  38.  
  39. peri_int        equ     060h
  40.  
  41. ;
  42. ; Set prt_scr non-zero to assemble code that allows control via SHIFT-PrtSc.
  43. ;
  44.  
  45. prt_scr         equ     1
  46.  
  47. ;
  48. ; Set use_prt non-zero to start up using the printer instead of the screen
  49. ;
  50.  
  51. use_prt         equ     0
  52.  
  53. ;
  54. ; Set num_feeds to number of extra Linefeeds to send to printer to jack
  55. ; up the paper enough to let you read it, after display of menus etc.
  56. ; Note! in TRACE2E.AIC
  57.  
  58. Num_feeds       equ     5       ;Number of line feeds on printer after prompt
  59.  
  60. ;********************************************************
  61. ;
  62. ; Equates used for printing and formatting
  63. ;
  64. ;********************************************************
  65.  
  66. Edit_End        equ     0f0h    ;End of input line
  67. Edit_Byte       equ     0f1h    ;Next byte is 8-bit value to be printed in hex
  68. Edit_Word       equ     0f2h    ;Next 2 bytes are 16-bit value to be printed in hex
  69. Edit_Line       equ     0f3h    ;Next 2 bytes are address of string for print_line()
  70. Edit_Call       equ     0f4h    ;Next byte is AH arg, next 2 are DX arg,
  71.                                 ;and next 2 are subroutine address to call
  72. Edit_Dec8       equ     0f5h    ;Next byte is 8-bit value to be printed as decimal
  73. Edit_Dec16      equ     0f6h    ;Next 2 bytes are 16-bit value to be printed as decimal
  74. Edit_Skip       equ     0f7h    ;Ignore this byte (don't display it)
  75.  
  76.  
  77. ;********************************************************
  78. ;
  79. ; Map of Before and After entries in the trace table
  80. ;
  81. ;********************************************************
  82.  
  83. ;
  84. ; Trace entry byte zero (the type byte) identifies entry as follows:
  85. ;   Bits 7-4 = trace type
  86. ;
  87. ;               0000 = BEFORE int was executed
  88. ;               0001 = AFTER int was executed
  89. ;               0010 = FCB referenced by an INT 21h
  90. ;               0011 = ASCIIZ referenced by an INT 21h
  91. ;
  92. ;   Bit 3    = RESERVED
  93. ;
  94. ;   Bits 2-0 = ICT # (0-7) which made this trace record
  95. ;
  96. ; Record formats are as follows:
  97. ;
  98.  
  99. BEFORE          struc           ;BEFORE trace entry
  100. B_type          db      ?       ;see above
  101. B_int           db      ?       ;INT # that was trapped
  102. B_ax            dw      ?       ;Regs BEFORE executing INT
  103. B_bx            dw      ?
  104. B_cx            dw      ?
  105. B_dx            dw      ?
  106. B_es            dw      ?
  107. B_ds            dw      ?
  108. B_ss            dw      ?
  109. B_sp            dw      ?
  110. B_si            dw      ?
  111. B_di            dw      ?
  112. B_bp            dw      ?
  113. B_cs            dw      ?       ;CS of invoker of INT
  114. B_ip            dw      ?       ;IP of invoker
  115. BEFORE          ends
  116.  
  117. AFTER           struc           ;AFTER record type
  118. A_type          db      ?       ;see above
  119. A_int           db      ?       ;INT # that was executed
  120. A_ax            dw      ?       ;Regs AFTER executing INT
  121. A_bx            dw      ?
  122. A_cx            dw      ?
  123. A_dx            dw      ?
  124. A_es            dw      ?
  125. A_ds            dw      ?
  126. A_si            dw      ?
  127. A_di            dw      ?
  128. A_bp            dw      ?
  129. A_flags         dw      ?       ;Flags AFTER doing INT
  130. AFTER           ends
  131.  
  132. FCB             struc                   ;INT 21h FCB record
  133. FCB_type        db      ?               ;see above
  134. FCB_int         db      ?               ;INT # that was executed (21h)
  135. FCB_drive       db      ?               ;drive field of FCB
  136. FCB_name        db      "????????"      ;filename field of FCB
  137. FCB_ext         db      "???"           ;extension field of FCB
  138. FCB             ends
  139.  
  140. ASCIIZ          struc                   ;INT 21h ASCIIZ record
  141. AZ_type         db      ?               ;see above
  142. AZ_int          db      ?               ;INT # that was executed (21h)
  143. AZ_str          db      "?????????????????????????????????????????????????????????????????"
  144. ASCIIZ          ends
  145.  
  146.  
  147. ;********************************************************
  148. ;
  149. ; Definition of Interrupt Control Table count
  150. ;
  151. ;********************************************************
  152.  
  153. number_icts     equ     16     ;note: number of ICT's 
  154.                                ;built into executable code
  155.                                ;in trace1.asm
  156.  
  157. ;********************************************************
  158. ;
  159. ; Definition of Interrupt Control Table entries
  160. ;
  161. ;********************************************************
  162.  
  163. ICT             struc
  164. ICT_flags       db      ?       ;See below
  165. ICT_flags2      db      ?       ;See belop
  166. ICT_intnum      db      ?       ;interrupt # this table belongs to
  167. ICT_AH_lo       db      ?       ;lower AH limit to trace
  168. ICT_AH_hi       db      ?       ;upper AH limit to trace
  169. ICT_orig_hndlr  dd      ?       ;cs:ip of original handler
  170. ICT_hits        dw      ?       ;# traces made for this ICT
  171. ICT_num         db      ?       ;ICT number (0-7)
  172. ICT             ends
  173.  
  174. ;
  175. ; Equates for flags byte of ICT
  176. ;
  177.  
  178. F_ACTIVE        equ     10000000b       ;Bit 7 = this ICT is active
  179. F_RET           equ     01000000b       ;Bit 6 = This INT exits via RET
  180. F_RET2          equ     00100000b       ;Bit 5 = This INT exits via RET2
  181. F_IRET          equ     00010000b       ;Bit 4 = This INT exits via IRET
  182. F_ENABLE        equ     00001000b       ;Bit 3 = Tracing enabled for this ICT
  183. F_FCB           equ     00000100b       ;Bit 2 = enable FCB/ASCII traces for INT 21h
  184. F_ROM           equ     00000010b       ;Bit 1 = exclude ROM invocations of this INT
  185. F_BELOW         equ     00000001b       ;Bit 0 = exclude invokers below us (DOS etc)
  186.  
  187. ;
  188. ; Equates for flags2 byte of ICT
  189. ;
  190.  
  191. F_CALL          equ     10000000b       ;Bit 7 = This ICT never returns
  192.  
  193.  
  194. ;
  195. ; Define interrupts to be traced by filling in the following ICT's.
  196. ; Note that there are only 8. That's the max that can be traced.
  197. ; Note that the F_ACTIVE flag must be set in used ICT's, and off in
  198. ; those that aren't defining something that you want traced.
  199. ;
  200. ; Don't mess with the last 3 fields in the ICT!!! Leave 'em as-is.
  201. ;
  202. ;   It is EXTREMELY important that you specify how the interrupt exits.
  203. ;   Set exactly one of the following flag bits:
  204. ;
  205. ;   F_RET   Interrupt exits via simple far RET, leaving original interrupts
  206. ;           on the stack for the caller to pop. INT's 025H and 026H are prime
  207. ;           examples.
  208. ;
  209. ;   F_RET2  Interrupt exits via RET 2, dropping original flags and returning
  210. ;           flags as set by interrupt handler. INT 021H (and anybody else
  211. ;           that uses flags like CARRY or ZERO to reflect results) does this.
  212. ;
  213. ;   F_IRET  Interrupt exits via IRET, restoring original flags from stack.
  214. ;           Hardware interrupt handlers do this, and many ROM BIOS routines.
  215. ;
  216. ;   Note that some interrupts may exit differently, depending on the specific
  217. ;   function requested. You may want to define several ICT's for a given
  218. ;   interrupt, each handling a different AH range.
  219. ;
  220. ;
  221.  
  222.